﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MobileAPI.DAL;
using MobileAPI.Entity.Model;
namespace MobileAPI.BLL
{
   public class BLLLogin:BaseBLL
    {
       private DALLogin dALLogin;
       public DALLogin DALLogin
       {
           get
           {
               if (dALLogin == null)
               {
                   dALLogin = DALFactory.getInstance().CreateLoginDAL();
               }
               return dALLogin;
           }
       }

       /// <summary>
       /// 登录是否成功
       /// </summary>
       /// <param name="UserName"></param>
       /// <param name="Password"></param>
       /// <returns></returns>
       public EUser UserLogin(string UserName, string Password)
       {
           try
           {
               return DALLogin.UserLogin(UserName, Password);
           }
           catch (Exception e)
           {
               base.WriteLog(e.Message);
               throw e;
           }
       }

       /// <summary>
       /// 有户名是否存在
       /// </summary>
       /// <param name="UserName"></param>
       /// <returns></returns>
       public bool IsUserExit(string UserName)
       {
           try
           {
               return DALLogin.IsUserExit(UserName);
           }
           catch (Exception e)
           {
               base.WriteLog(e.Message);
               throw e;
           }
       }
    }
}
